$(function(){
    function getId(){
        return location.hash.split("=")[1];
    }
    $(window).ready(function(){
        $.ajax({
            url:"http://127.0.0.1:8888/goods/item/" + getId(),
            dataType:"json"
        })
        .done(function(data){
            render(data)
            console.log(data);
        })
    })
    var logo = document.getElementById('logo');
    var detail = document.querySelector(".detail");
    var title = document.getElementById("title");
    var logo2=document.getElementById("logo2")
    
    function render( res ){
            // res = JSON.parse( res );
            console.log( res.info );
            logo.src = res.info.img_big_logo;
            logo2.src = res.info.img_big_logo;
            detail.innerHTML = res.info.goods_introduce;
            title.innerHTML = res.info.title;
    }
    
})
